"""
1、使用while，完成以下图形的输出
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*

2、break和continue的区别：
break(终止):满足当前条件后终止所在所有循环操作
continue(继续):满足当前条件后跳过单循环操作，后续循环继续执行

"""

row = 1
while row <= 5:
    column = 1
    while column <= row:
        print("*", end=' ')
        column += 1
    print()
    row += 1
row -= 1
while row >= 1:
    column = row - 1
    while column >= 1:
        print("*", end=' ')
        column -= 1
    print()
    row -= 1

print()

# 作业标准答案

# 最大星星数
my_num = 5
# 循环次数
row_index = 1

while row_index <= 2 * my_num - 1:
    # 定义一个列数
    col_index = 1
    # 完成打印上半部分
    if row_index <= my_num:
        while col_index <= row_index:
            print("*", end="")
            col_index += 1
    else:
        # 完成打印下半部分
        while col_index <= 2 * my_num - row_index:
            print("*", end="")
            col_index += 1
    print()
    row_index += 1

i = 1
while i < 5:
    i += 1
    if i == 2:
        continue
    print(i)  # 3 4 5

for num in range(1, 5):
    if num == 2:
        break
    print(num)   # 1
